package tetris;

import java.util.*;

public class Square {
    int[][] sxy = new int[4][2];
    Random random=new Random(137);
    float[] scolor = new float[4];
    int b=(int)(Math.random()*16);
    int c=(int)(Math.random()*7);
    int[][] squ={{4,1,4,0,4,2,4,3},            //1型
                 {4,0,3,0,5,0,6,0},            //反1
                 {4,1,4,0,4,2,5,2},            //L型
                 {5,1,5,0,5,2,4,2},            //反L
                 {4,1,4,0,5,1,5,2},             //5
                 {5,1,5,0,4,1,4,2},            //反5
                 {4,1,4,0,4,2,5,1},             //1-
                 {5,1,5,0,5,2,4,1},            //-1
                 {4,0,4,1,5,0,5,1},              //田
                 {4,1,4,0,3,1,5,0},             //_|-
                 {4,1,3,0,4,0,5,1},             //-|_
                 {4,1,4,0,3,1,5,1},             //土
                 {4,0,4,1,3,0,5,0},             //下
                 {5,1,4,0,5,0,5,2},             //7
                 {4,1,4,0,4,2,5,0},              //反7
                 {4,0,3,0,5,0,6,0}
    };
    float[][] crgb={{1f,0f,0f,1f},
                    {0f,1f,0f,1f},
                    {0f,0.5f,1f,1f},
                    {0.9f,0.7f,0.5f,1f},
                    {1f,0f,0.5f,1f},
                    {1f,1f,1f,1f},
                    {0.5f,0f,0.5f,1f}
    };
    public Square(){
        sxy[0][0]=squ[b][0];
        sxy[0][1]=squ[b][1];
        sxy[1][0]=squ[b][2];
        sxy[1][1]=squ[b][3];
        sxy[2][0]=squ[b][4];
        sxy[2][1]=squ[b][5];
        sxy[3][0]=squ[b][6];
        sxy[3][1]=squ[b][7];
        scolor=crgb[c];
    }
}
